/*!
 * misc.c
 * Definitions for miscellaneous functions for Qong.
 * \author	Jon "delrio" Cox
 * \date	February 1, 2011
 */

//------------------------------------------------------------------------//
//  Qong                                                                  //
//  Copyright (C) 2011 Jon Cox                                            //
//                                                                        //
//  This program is free software: you can redistribute it and/or modify  //
//  it under the terms of the GNU General Public License as published by  //
//  the Free Software Foundation, either version 3 of the License, or     //
//  (at your option) any later version.                                   //
//                                                                        //
//  This program is distributed in the hope that it will be useful,       //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of        //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
//  GNU General Public License for more details.                          //
//                                                                        //
//  You should have received a copy of the GNU General Public License     //
//  along with this program.  If not, see <http://www.gnu.org/licenses/>. //
//------------------------------------------------------------------------//

#include <stdio.h>
#include <stdlib.h>
#include <types.h>
#include <misc.h>

//! Prints an error to stderr, quits if error is fatal.
/*!
 * \param fatal	If set to true, the program will quit with an error.
 * \param text	Message to print to stderr.
 */
void ERROR( bool_t fatal, char *text )
{
	if ( fatal )
	{
		fprintf( stderr, "FATAL ERROR: %s\n", text );
		exit(1);
	}
	fprintf( stderr, "ERROR: %s\n", text );
}
